import pathToRegexp from 'path-to-regexp/index';
import {isloginState} from 'services/app';
export default {
    namespace: 'dashboard',
    state: {
        bodyWidth:document.body.clientWidth,
    },
    subscriptions: {
        setupHistory ({ dispatch, history }) {
            history.listen((location) => {
                const match = pathToRegexp('/home').exec(location.pathname);
                if (match) {
                    // empty
                }
            });
        },
        setup ({ dispatch }) {},
    },
    effects: {
        //获取屏幕宽度
        * changeWidth ({ payload }, { call, put }) {},
        //查看登录状态
        *isloginState ({ payload }, { call, put }){
            yield call(isloginState, {
                userName:"111111",
                userPwd:'111111',
            });
        },
    },
    reducers: {
        save (state, { payload }) {
            return { ...state, ...payload };
        },
    },
};
